#include "stdafx.h"
#include "Alien.h"


CAlien::CAlien()
{
}


CAlien::~CAlien()
{
}

CAlien::CAlien(float x_, float y_, float w_, float h_, int tex_) :CSprite(x_, y_, w_, h_, tex_)
{
}

void
CAlien::update(float dt_)
{

	if (movingRight == true)
	{
		m_fX += 0.02;
	}
	else if (movingRight == false)
	{
		m_fX -= 0.02;
	}

	if (movingUp == true)
	{
		m_fY += 0.02;
	}

	else if (movingUp == false)
	{
		m_fY -= 0.02;
	}


	if (m_fX < -3.2)
	{
		movingRight = true;
		m_fY -= 0.07;
	}
	
	if (m_fX > 3.2)
	{
		movingRight = false;
		m_fY -= 0.07;
	}

	if (m_fY < -0.7)
	{
		movingUp = true;
		
	}

	if (m_fY > 2)
	{
		movingUp = false;
		
	}
}